Skip to content

feat(dev): Add flamegraphs to live dashboard in non-prod#3313

Merged
thecristen merged 1 commit into
mainfrom
cbjdl/add-flamegraphs-in-non-prod
Jul 6, 2026
Merged

feat(dev): Add flamegraphs to live dashboard in non-prod#3313
thecristen merged 1 commit into
mainfrom
cbjdl/add-flamegraphs-in-non-prod

Conversation

@joshlarson

@joshlarson joshlarson commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Scope

No ticket, but this tool has been quite helpful for profiling things like the homepage load times. So far, we've been using it by cherry-picking this commit onto different pieces of work, but I don't see any reason we couldn't just commit it.

Caution

It is very important that flame_on, or flamegraphs in general, not be enabled in production, because it messes with how function calls work and can slow down critical paths. It's currently scoped to not run when Mix.env() is :prod, and the dep is only installed for :dev. We need to make sure to keep it that way.

Screenshots

Screenshot 2026-07-06 at 11 24 44 AM

A nice, interactive flamegraph from loading the homepage. Hovering over the entry for DotcomWeb.Plugs.RecentlyVisited.call/2 shows that it accounted for 8% of homepage load runtime.


Screenshot 2026-07-06 at 11 32 29 AM

You can click on an entry to zoom in and see more details about what happens within a particular call. Zooming in on the root layout shows that rendering alerts accounted for 39% of its runtime.

How to test

Navigate to the Flame On pane in the dashboard, click the Flame On! button and have fun!

Note

I've noticed that sometimes Flame On isn't able to do its thing, and times out instead. When that happens, restarting my computer seems to fix it.

@joshlarson joshlarson marked this pull request as ready for review July 6, 2026 15:36
@joshlarson joshlarson requested a review from a team as a code owner July 6, 2026 15:36
@joshlarson joshlarson requested a review from thecristen July 6, 2026 15:36
@thecristen thecristen added the dev-green Deploy to dev-green label Jul 6, 2026
@thecristen thecristen removed the dev-green Deploy to dev-green label Jul 6, 2026
@thecristen thecristen merged commit 99d7ad0 into main Jul 6, 2026
33 checks passed
@thecristen thecristen deleted the cbjdl/add-flamegraphs-in-non-prod branch July 6, 2026 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants